package com.lzw.zuoye02;

import java.util.*;

public class Jilin {
    public static void main(String[] args) {
        Map<String , List<String >> map = new HashMap();
        Scanner scanner = new Scanner(System.in);
        List<String> list = new ArrayList<>();
        map.put("黑龙江",list);
        List<String> list2 = new ArrayList<>();
        map.put("上海",list2);
        List<String> list3 = new ArrayList<>();
        map.put("吉林",list3);
        list3.add("长春");
        list3.add("延边");
        list3.add("吉林");
        list3.add("白山");
        list3.add("白城");
        list3.add("四平");
        list3.add("松原");
        while (true){
            System.out.println("——————————————————————————————————————");
            System.out.println("你好，请选择你所在的城市");
            System.out.println("黑龙江，上海，吉林，天津，河北，重庆，北京");
            System.out.println("请输入你所在的省份：");
            String province =scanner.next();
            if (map.get(province)==null){
                System.out.println("你输入的省份有误");
            }else {
                System.out.println(map.get(province));
                System.out.println("请输入你所在的城市：");
                String city = scanner.next();
                if (map.get(province).contains(city)){
                    System.out.println("信息录入成功");
                }else {
                    System.out.println("您输入的城市名称有误");
                }
            }
        break;
        }
    }
}

